package com.smy.jkds.po;

import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 卡片表
 * </p>
 *
 * @author 01140
 * @since 2021-10-30
 */
@Data
  @TableName("cts.jkds_card")
public class Card implements Serializable {

    private static final long serialVersionUID = 1L;

      //主键
       @TableId("id")
      private String id;

      //taskId
     @TableField("task_id")
    private String taskId;

      //用户ID
     @TableField("user_id")
    private String userId;

      //用户名称
     @TableField("user_name")
    private String userName;

      //卡片内容
     @TableField("content")
    private String content;

      //标签
     @TableField("tag")
    private String tag;

      //库
     @TableField("db")
    private String db;

      //创建时间
     @TableField("create_time")
    private Date createTime;

      //更新时间
     @TableField("update_time")
    private Date updateTime;

public QueryWrapper<Card> queryWrapper(){
        QueryWrapper<Card> queryWrapper = new QueryWrapper<>();
    if(id != null){
        queryWrapper.eq(ColumnEnum.id.name(),id);
    }
    if(taskId != null){
        queryWrapper.eq(ColumnEnum.task_id.name(),taskId);
    }
    if(userId != null){
        queryWrapper.eq(ColumnEnum.user_id.name(),userId);
    }
    if(userName != null){
        queryWrapper.eq(ColumnEnum.user_name.name(),userName);
    }
    if(content != null){
        queryWrapper.eq(ColumnEnum.content.name(),content);
    }
    if(tag != null){
        queryWrapper.eq(ColumnEnum.tag.name(),tag);
    }
    if(db != null){
        queryWrapper.eq(ColumnEnum.db.name(),db);
    }
    if(createTime != null){
        queryWrapper.eq(ColumnEnum.create_time.name(),createTime);
    }
    if(updateTime != null){
        queryWrapper.eq(ColumnEnum.update_time.name(),updateTime);
    }
        return queryWrapper;
}


public enum ColumnEnum {
        id,
        task_id,
        user_id,
        user_name,
        content,
        tag,
        db,
        create_time,
        update_time,
      ;
}
}
